import 'package:richedit/data/divider_entity.dart';

dividerEntityFromJson(DividerEntity data, Map<String, dynamic> json) {
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['color'] != null) {
		data.color = json['color'].toString();
	}
	if (json['height'] != null) {
		data.height = json['height'] is String
				? int.tryParse(json['height'])
				: json['height'].toInt();
	}
	return data;
}

Map<String, dynamic> dividerEntityToJson(DividerEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['name'] = entity.name;
	data['color'] = entity.color;
	data['height'] = entity.height;
	return data;
}